<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		function bian(){
			var img = document.getElementById('img');
			if(img.src.indexOf('on.jpg') < 0){
				img.src = './on.jpg';
			}else{
				img.src = './off.jpg';
			}
		}
	</script>
</head>
<body>
	<img id="img" src="./on.jpg" onclick="bian();" />
</body>
</html>